package src.main.java.org.thread.exercise;

import java.util.concurrent.atomic.AtomicInteger;

public class MyRunnable2 implements Runnable{
    //整数修改的乐观锁，原子类实现
    private AtomicInteger count = new AtomicInteger();
    @Override
    public void run() {
        for (int i = 0; i < 100; i++) {
                System.out.println("count ====>"+ count.incrementAndGet());//乐观锁


        }
    }
}
